package com.dragon.modules.yuegou.query.product;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.product.SpecsEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

/**
 * 规格图片信息表 动态查询条件
 * 
 * @author px
 * @date 2019-04-17 14:44:41
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class SpecsQuery extends SpecsEntity implements Query<SpecsEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** SPUID查询条件 */
	@JsonUnwrapped(prefix = "spuId")
	private Condition<String> spuIdCondition;

    /** 规格ID查询条件 */
	@JsonUnwrapped(prefix = "attributeId")
	private Condition<String> attributeIdCondition;

    /** 规格名称查询条件 */
	@JsonUnwrapped(prefix = "attributeName")
	private Condition<String> attributeNameCondition;

    /** 规格属性值ID查询条件 */
	@JsonUnwrapped(prefix = "optionId")
	private Condition<String> optionIdCondition;

    /** 规格属性值名称查询条件 */
	@JsonUnwrapped(prefix = "optionName")
	private Condition<String> optionNameCondition;

    /** 规格属性小图查询条件 */
	@JsonUnwrapped(prefix = "smallImg")
	private Condition<String> smallImgCondition;

    /** 规格属性图片列表查询条件 */
	@JsonUnwrapped(prefix = "imgs")
	private Condition<String> imgsCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public SpecsQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public SpecsQuery(SpecsEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public SpecsQuery(SpecsQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.spuIdCondition != null) {
			this.spuIdCondition = other.spuIdCondition.copy();
		}
		if(other.attributeIdCondition != null) {
			this.attributeIdCondition = other.attributeIdCondition.copy();
		}
		if(other.attributeNameCondition != null) {
			this.attributeNameCondition = other.attributeNameCondition.copy();
		}
		if(other.optionIdCondition != null) {
			this.optionIdCondition = other.optionIdCondition.copy();
		}
		if(other.optionNameCondition != null) {
			this.optionNameCondition = other.optionNameCondition.copy();
		}
		if(other.smallImgCondition != null) {
			this.smallImgCondition = other.smallImgCondition.copy();
		}
		if(other.imgsCondition != null) {
			this.imgsCondition = other.imgsCondition.copy();
		}
	}

	@Override
	public QueryWrapper<SpecsEntity> toQueryWrapper() {
		QueryWrapper<SpecsEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (spuIdCondition != null) {
			spuIdCondition.toWrapper(wrapper, COL_SPU_ID);
		}
		if (attributeIdCondition != null) {
			attributeIdCondition.toWrapper(wrapper, COL_ATTRIBUTE_ID);
		}
		if (attributeNameCondition != null) {
			attributeNameCondition.toWrapper(wrapper, COL_ATTRIBUTE_NAME);
		}
		if (optionIdCondition != null) {
			optionIdCondition.toWrapper(wrapper, COL_OPTION_ID);
		}
		if (optionNameCondition != null) {
			optionNameCondition.toWrapper(wrapper, COL_OPTION_NAME);
		}
		if (smallImgCondition != null) {
			smallImgCondition.toWrapper(wrapper, COL_SMALL_IMG);
		}
		if (imgsCondition != null) {
			imgsCondition.toWrapper(wrapper, COL_IMGS);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回SPUID查询条件
	 * 
	 * @return spuIdCondition SPUID查询条件
	 */
	public Condition<String> spuId() {
		this.spuIdCondition = new Condition<>();
		return this.spuIdCondition;
	}
	
	/**
	 * 获取SPUID查询条件
	 * 
	 * @return spuIdCondition SPUID查询条件
	 */
	public Condition<String> getSpuIdCondition() {
		return spuIdCondition;
	}

	/**
	 * 设置SPUID查询条件
	 * 
	 * @param spuIdCondition SPUID查询条件
	 */
	public void setSpuIdCondition(Condition<String> spuIdCondition) {
		this.spuIdCondition = spuIdCondition;
	}

	/**
	 * 构造并返回规格ID查询条件
	 * 
	 * @return attributeIdCondition 规格ID查询条件
	 */
	public Condition<String> attributeId() {
		this.attributeIdCondition = new Condition<>();
		return this.attributeIdCondition;
	}
	
	/**
	 * 获取规格ID查询条件
	 * 
	 * @return attributeIdCondition 规格ID查询条件
	 */
	public Condition<String> getAttributeIdCondition() {
		return attributeIdCondition;
	}

	/**
	 * 设置规格ID查询条件
	 * 
	 * @param attributeIdCondition 规格ID查询条件
	 */
	public void setAttributeIdCondition(Condition<String> attributeIdCondition) {
		this.attributeIdCondition = attributeIdCondition;
	}

	/**
	 * 构造并返回规格名称查询条件
	 * 
	 * @return attributeNameCondition 规格名称查询条件
	 */
	public Condition<String> attributeName() {
		this.attributeNameCondition = new Condition<>();
		return this.attributeNameCondition;
	}
	
	/**
	 * 获取规格名称查询条件
	 * 
	 * @return attributeNameCondition 规格名称查询条件
	 */
	public Condition<String> getAttributeNameCondition() {
		return attributeNameCondition;
	}

	/**
	 * 设置规格名称查询条件
	 * 
	 * @param attributeNameCondition 规格名称查询条件
	 */
	public void setAttributeNameCondition(Condition<String> attributeNameCondition) {
		this.attributeNameCondition = attributeNameCondition;
	}

	/**
	 * 构造并返回规格属性值ID查询条件
	 * 
	 * @return optionIdCondition 规格属性值ID查询条件
	 */
	public Condition<String> optionId() {
		this.optionIdCondition = new Condition<>();
		return this.optionIdCondition;
	}
	
	/**
	 * 获取规格属性值ID查询条件
	 * 
	 * @return optionIdCondition 规格属性值ID查询条件
	 */
	public Condition<String> getOptionIdCondition() {
		return optionIdCondition;
	}

	/**
	 * 设置规格属性值ID查询条件
	 * 
	 * @param optionIdCondition 规格属性值ID查询条件
	 */
	public void setOptionIdCondition(Condition<String> optionIdCondition) {
		this.optionIdCondition = optionIdCondition;
	}

	/**
	 * 构造并返回规格属性值名称查询条件
	 * 
	 * @return optionNameCondition 规格属性值名称查询条件
	 */
	public Condition<String> optionName() {
		this.optionNameCondition = new Condition<>();
		return this.optionNameCondition;
	}
	
	/**
	 * 获取规格属性值名称查询条件
	 * 
	 * @return optionNameCondition 规格属性值名称查询条件
	 */
	public Condition<String> getOptionNameCondition() {
		return optionNameCondition;
	}

	/**
	 * 设置规格属性值名称查询条件
	 * 
	 * @param optionNameCondition 规格属性值名称查询条件
	 */
	public void setOptionNameCondition(Condition<String> optionNameCondition) {
		this.optionNameCondition = optionNameCondition;
	}

	/**
	 * 构造并返回规格属性小图查询条件
	 * 
	 * @return smallImgCondition 规格属性小图查询条件
	 */
	public Condition<String> smallImg() {
		this.smallImgCondition = new Condition<>();
		return this.smallImgCondition;
	}
	
	/**
	 * 获取规格属性小图查询条件
	 * 
	 * @return smallImgCondition 规格属性小图查询条件
	 */
	public Condition<String> getSmallImgCondition() {
		return smallImgCondition;
	}

	/**
	 * 设置规格属性小图查询条件
	 * 
	 * @param smallImgCondition 规格属性小图查询条件
	 */
	public void setSmallImgCondition(Condition<String> smallImgCondition) {
		this.smallImgCondition = smallImgCondition;
	}

	/**
	 * 构造并返回规格属性图片列表查询条件
	 * 
	 * @return imgsCondition 规格属性图片列表查询条件
	 */
	public Condition<String> imgs() {
		this.imgsCondition = new Condition<>();
		return this.imgsCondition;
	}
	
	/**
	 * 获取规格属性图片列表查询条件
	 * 
	 * @return imgsCondition 规格属性图片列表查询条件
	 */
	public Condition<String> getImgsCondition() {
		return imgsCondition;
	}

	/**
	 * 设置规格属性图片列表查询条件
	 * 
	 * @param imgsCondition 规格属性图片列表查询条件
	 */
	public void setImgsCondition(Condition<String> imgsCondition) {
		this.imgsCondition = imgsCondition;
	}

}
